<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/','index\WebpageController@index');
Route::get('/admin','admin\IndexController@index');

// 后台
Route::group(['middleware' => 'adminlogin'],function(){
	Route::prefix('admin')->group(function () {
		// 首页
		Route::get('/a','admin\IndexController@index');
		Route::get('/index_v1','admin\IndexController@index_v1');
		Route::get('/index_v2','admin\IndexController@index_v2');
		// 管理员
		Route::prefix('/bkuser')->group(function(){
			Route::get('/bkuser_list','admin\BkuserController@bkuser_list');
			Route::get('/bkuser_add','admin\BkuserController@bkuser_add');
			Route::post('/bkuser_insert','admin\BkuserController@bkuser_insert');
			Route::delete('/bkuser_del','admin\BkuserController@bkuser_del');
			Route::get('/bkuser_edit','admin\BkuserController@bkuser_edit');
			Route::post('/bkuser_update','admin\BkuserController@bkuser_update');
		});
		// 前台用户
		Route::prefix('/vip')->group(function(){
			Route::get('/vip_list','admin\vipController@vip_list');
			Route::delete('/vip_del','admin\VipController@vip_del');
			Route::post('/vip_update','admin\VipController@vip_update');
		});
		//轮播管理
		Route::prefix('/carousel')->group(function(){
			//展示页面
			Route::get('/index','admin\CarouselController@index');
			//执行添加
			Route::post('/insert','admin\CarouselController@insert');
			//执行删除
			Route::get('/del','admin\CarouselController@del');
			//执行修改
			Route::post('/update','admin\CarouselController@update');
		});
		// 商品分类
		Route::prefix('/goodscategory')->group(function(){
			Route::get('/goodscategory_list','admin\GoodscategoryController@goodscategory_list');
			Route::get('/goodscategory_add','admin\GoodscategoryController@goodscategory_add');
			Route::post('/goodscategory_insert','admin\GoodscategoryController@goodscategory_insert');
			Route::delete('/goodscategory_del','admin\GoodscategoryController@goodscategory_del');
			Route::get('/goodscategory_edit','admin\GoodscategoryController@goodscategory_edit');
			Route::post('/goodscategory_update','admin\GoodscategoryController@goodscategory_update');
		});
		// 商品
		Route::prefix('/goods')->group(function(){
			Route::get('/goods_list','admin\GoodsController@goods_list');
			Route::get('/goods_add','admin\GoodsController@goods_add');
			Route::post('/goods_insert','admin\GoodsController@goods_insert');
			Route::delete('/goods_del','admin\GoodsController@goods_del');
			Route::get('/goods_edit','admin\GoodsController@goods_edit');
			Route::post('/goods_update','admin\GoodsController@goods_update');

			Route::get('/goodssize_list','admin\GoodsController@goodssize_list');
			Route::get('/goodssize_add','admin\GoodsController@goodssize_add');
			Route::post('/goodssize_insert','admin\GoodsController@goodssize_insert');
			Route::delete('/goodssize_del','admin\GoodsController@goodssize_del');
			Route::get('/goodssize_edit','admin\GoodsController@goodssize_edit');
			Route::post('/goodssize_update','admin\GoodsController@goodssize_update');

			Route::get('/goodsimg_list','admin\GoodsController@goodsimg_list');
			Route::post('/goodsimg_insert','admin\GoodsController@goodsimg_insert');
			Route::delete('/goodsimg_del','admin\GoodsController@goodsimg_del');
			Route::get('/goodsimg_edit','admin\GoodsController@goodsimg_edit');
			Route::post('/goodsimg_update','admin\GoodsController@goodsimg_update');

			Route::get('/goods_details','admin\GoodsController@goods_details');
		});
		// 订单管理
		Route::prefix('/order')->group(function(){
			// 订单列表
			Route::get('/order_list','admin\OrderController@order_list');
			// 发货
			Route::get('/delivergoods','admin\OrderController@delivergoods');
		});
		// 商品评论
		Route::prefix('/goodscomment')->group(function(){
			// 评论列表
			Route::get('/goodscomment_list','admin\GoodscommentController@goodscomment_list');
			// 评论详情
			Route::get('/goodscomment_details','admin\GoodscommentController@goodscomment_details');
			// 评论回复
			Route::post('/goodscomment_reply','admin\GoodscommentController@goodscomment_reply');
		});
		// 表单验证
		Route::get('/validate/telrepeat','admin\ValidateController@telrepeat');
		Route::get('/validate/usernamerepeat','admin\ValidateController@usernamerepeat');
	});
});

// 后台
Route::prefix('admin')->group(function () {
	//后台登录&退出
	Route::any('/login','admin\LoginController@login');
	//后台退出
	Route::any('/quit','admin\LoginController@quit');
	//执行登录
	Route::any('/login1','admin\IndexController@login');
});

// 前台
Route::prefix('index')->group(function(){
	Route::prefix('/vip')->group(function(){
		//登录页面
		Route::get('/login','index\VipController@login');
		//发送验证码
		Route::post('/message','index\VipController@message');
		//验证手机号是否重复
		Route::post('/yanzheng','index\VipController@yanzheng');
		//执行注册
		Route::any('/add','index\VipController@add');
		//执行登录
		Route::any('/login2','index\VipController@login2');
		//找回密码
		Route::any('/zhpassword','index\VipController@zhpassword');
		//退出
		Route::any('/quit','index\VipController@quit');
	});
	// 网站页面
	Route::prefix('/webpage')->group(function(){
		// 商品列表
		Route::get('/item_category','index\WebpageController@item_category');
		// 商品详情
		Route::get('/item_show','index\WebpageController@item_show');
		// 筛选商品
		Route::post('/changesize','index\WebpageController@changesize');
	});
});
Route::group(['middleware' => 'viplogin'],function(){
	Route::prefix('index')->group(function () {
		// 个人中心
		Route::prefix('/vip')->group(function(){
			// 收货地址
			Route::get('/udai_address','index\VipController@udai_address');
			// 收货地址添加
			Route::post('/udai_address_insert','index\VipController@udai_address_insert');
			Route::delete('/udai_address_del','index\VipController@udai_address_del');
			// 收货地址修改页面
			Route::get('/udai_address_edit','index\VipController@udai_address_edit');
			// 收货地址修改
			Route::post('/udai_address_update','index\VipController@udai_address_update');
			// 修改支付密码
			Route::get('/udai_paypwd_modify','index\VipController@udai_paypwd_modify');
			// 修改登录密码
			Route::get('/udai_pwd_modify','index\VipController@udai_pwd_modify');
			// 修改登录密码step1-验证旧密码
			Route::post('/modifypwd_step1','index\VipController@modifypwd_step1');
			// 修改登录密码step2-输入新密码
			Route::post('/modifypwd_step2','index\VipController@modifypwd_step2');
			// 个人信息设置
			Route::get('/udai_setting','index\VipController@udai_setting');
			// 个人信息更改
			Route::post('/userinfo_update','index\VipController@userinfo_update');
			// 用户头像设置
			Route::post('/user_icon_update','index\VipController@user_icon_update');
			Route::get('/udai_welcome','index\VipController@udai_welcome');
		});
		// 购物车
		Route::prefix('/shopcart')->group(function(){
			// 购物车页面
			Route::get('/udai_shopcart','index\ShopcartController@udai_shopcart');
			// 添加到购物车
			Route::post('/shopcart_insert','index\ShopcartController@shopcart_insert');
			// 从购物车中删除
			Route::delete('/shopcart_del','index\ShopcartController@shopcart_del');
			// 改变所购商品数量
			Route::post('/shopcart_changenum','index\ShopcartController@shopcart_changenum');
			// 购物车结算
			Route::post('/udai_shopcart_pay','index\ShopcartController@udai_shopcart_pay');
		});
		// 订单
		Route::prefix('/order')->group(function(){
			// 确认订单
			Route::post('/order_insert','index\OrderController@order_insert');
			// 订单结算
			Route::get('/order_pay','index\OrderController@order_pay');
			// 支付成功
			Route::post('/order_paydone','index\OrderController@order_paydone');
			// 取消订单
			Route::get('/order_cancel','index\OrderController@order_cancel');
			// 确认收货
			Route::get('/udai_order_receipted','index\OrderController@udai_order_receipted');
			// 确认收货成功
			Route::post('/order_receipteddone','index\OrderController@order_receipteddone');
			// 订单列表
			Route::get('/udai_order','index\OrderController@udai_order');
			// 订单详情
			Route::get('/udai_order_detail','index\OrderController@udai_order_detail');
			// 订单评价
			Route::get('/udai_order_evaluate','index\OrderController@udai_order_evaluate');
			// 提交评价
			Route::post('/evaluate_insert','index\OrderController@evaluate_insert');
			// 订单删除
			Route::get('/order_del','index\OrderController@order_del');
		});
	});
});



